(function (window, undefined) {
    class Brick extends Father {
        constructor(parent, option = { width: 900, height: 600, color: "" }) {
            super(parent, option)
        }
        renderBrickTage() {
            this.balls = []
            super.render(this.balls)
            this.balls[0].style.width = "1000px"
            this.balls[0].style.margin = "50px auto"
            this.renderBrick()
        }
        renderBrick() {
            this.eles = []
            this.x = this.balls[0].offsetLeft
            console.log();
            this.y = 40
            for (let i = 0; i < 5; i++) {
                for (let j = 0; j < 16; j++) {
                    const ele = document.createElement("div")
                    ele.style.position = "absolute"
                    ele.style.width = "45px"
                    ele.style.height = "20px"
                    ele.style.top = this.y + "px"
                    ele.style.left = this.x + 65 * j + "px"

                    ele.style.backgroundColor = "lightgreen"

                    this.balls[0].appendChild(ele)
                    this.eles.push(ele)
                }
                this.y = this.y + 40
            }
        }
        removeBrick(i) {
            this.balls[0].removeChild(this.eles[i])
            this.eles.splice(i, 1)
        }

    }
    window.Brick = Brick
})(window, undefined)